using com.byt.suce.db.dao;
using System;
using System.Data;
using System.Data.Common;
using com.byt.webcore;
using System.Collections.Generic;
using MYLSOFT.JsonSimple;
using System.Data.SqlClient;

namespace com.byt.suce.db.mapper {

    public class PkgMant : AbstractDataAccessObject , IPkgMant {

        public PkgMant() {
        }

        public PkgMant.ActGetlistParam actGetlist(Connection conn, Dictionary<string, string> map) {
            PkgMant.ActGetlistParam param = newActGetlistParam(map);
            actGetlist(conn, param);
            return param;
        }

        public PkgMant.ActGetlistParam actGetlist(Connection conn, JSONObject json) {
            PkgMant.ActGetlistParam param = newActGetlistParam(json);
            actGetlist(conn, param);
            return param;
        }

        public PkgMant.ActGetlistParam actGetlist(Connection conn) {
            PkgMant.ActGetlistParam param = newActGetlistParam();
            actGetlist(conn, param);
            return param;
        }

        public void actGetlist(Connection conn, PkgMant.ActGetlistParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].MAN_act_getlist";
            DbParameter par = null;
            // cur_out
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_out";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            DataSet ds = new DataSet();
            DataAdapter da = new SqlDataAdapter((SqlCommand)cmd);
            da.Fill(ds);
            param.CurOut = (DbDataReader)ds.Tables[0].CreateDataReader();
        }

        public PkgMant.ClasificacionSearchParam clasificacionSearch(Connection conn, Dictionary<string, string> map) {
            PkgMant.ClasificacionSearchParam param = newClasificacionSearchParam(map);
            clasificacionSearch(conn, param);
            return param;
        }

        public PkgMant.ClasificacionSearchParam clasificacionSearch(Connection conn, JSONObject json) {
            PkgMant.ClasificacionSearchParam param = newClasificacionSearchParam(json);
            clasificacionSearch(conn, param);
            return param;
        }

        public PkgMant.ClasificacionSearchParam clasificacionSearch(Connection conn) {
            PkgMant.ClasificacionSearchParam param = newClasificacionSearchParam();
            clasificacionSearch(conn, param);
            return param;
        }

        public void clasificacionSearch(Connection conn, PkgMant.ClasificacionSearchParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].MAN_clasificacion_search";
            DbParameter par = null;
            // nombclasificacion
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@nombclasificacion";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 200;
            if (string.IsNullOrEmpty(param.Nombclasificacion))
                par.Value = DBNull.Value;
            else
                par.Value = param.Nombclasificacion;
            // cur_out
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_out";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            DataSet ds = new DataSet();
            DataAdapter da = new SqlDataAdapter((SqlCommand)cmd);
            da.Fill(ds);
            param.CurOut = (DbDataReader)ds.Tables[0].CreateDataReader();
        }

        public PkgMant.FormatoGetlistParam formatoGetlist(Connection conn, Dictionary<string, string> map) {
            PkgMant.FormatoGetlistParam param = newFormatoGetlistParam(map);
            formatoGetlist(conn, param);
            return param;
        }

        public PkgMant.FormatoGetlistParam formatoGetlist(Connection conn, JSONObject json) {
            PkgMant.FormatoGetlistParam param = newFormatoGetlistParam(json);
            formatoGetlist(conn, param);
            return param;
        }

        public PkgMant.FormatoGetlistParam formatoGetlist(Connection conn) {
            PkgMant.FormatoGetlistParam param = newFormatoGetlistParam();
            formatoGetlist(conn, param);
            return param;
        }

        public void formatoGetlist(Connection conn, PkgMant.FormatoGetlistParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].MAN_formato_getlist";
            DbParameter par = null;
            // cur_out
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_out";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            DataSet ds = new DataSet();
            DataAdapter da = new SqlDataAdapter((SqlCommand)cmd);
            da.Fill(ds);
            param.CurOut = (DbDataReader)ds.Tables[0].CreateDataReader();
        }

        public PkgMant.UitGetbyidParam uitGetbyid(Connection conn, Dictionary<string, string> map) {
            PkgMant.UitGetbyidParam param = newUitGetbyidParam(map);
            uitGetbyid(conn, param);
            return param;
        }

        public PkgMant.UitGetbyidParam uitGetbyid(Connection conn, JSONObject json) {
            PkgMant.UitGetbyidParam param = newUitGetbyidParam(json);
            uitGetbyid(conn, param);
            return param;
        }

        public PkgMant.UitGetbyidParam uitGetbyid(Connection conn) {
            PkgMant.UitGetbyidParam param = newUitGetbyidParam();
            uitGetbyid(conn, param);
            return param;
        }

        public void uitGetbyid(Connection conn, PkgMant.UitGetbyidParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].MAN_uit_getbyid";
            DbParameter par = null;
            // idparametro
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idparametro";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Idparametro == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Idparametro;
            // cur_out
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_out";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            DataSet ds = new DataSet();
            DataAdapter da = new SqlDataAdapter((SqlCommand)cmd);
            da.Fill(ds);
            param.CurOut = (DbDataReader)ds.Tables[0].CreateDataReader();
        }

        public PkgMant.UitGetlistParam uitGetlist(Connection conn, Dictionary<string, string> map) {
            PkgMant.UitGetlistParam param = newUitGetlistParam(map);
            uitGetlist(conn, param);
            return param;
        }

        public PkgMant.UitGetlistParam uitGetlist(Connection conn, JSONObject json) {
            PkgMant.UitGetlistParam param = newUitGetlistParam(json);
            uitGetlist(conn, param);
            return param;
        }

        public PkgMant.UitGetlistParam uitGetlist(Connection conn) {
            PkgMant.UitGetlistParam param = newUitGetlistParam();
            uitGetlist(conn, param);
            return param;
        }

        public void uitGetlist(Connection conn, PkgMant.UitGetlistParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].MAN_uit_getlist";
            DbParameter par = null;
            // cur_out
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@cur_out";
            par.Direction = ParameterDirection.InputOutput;
            par.DbType = DbType.Object;
            par.Value = DBNull.Value;
            DataSet ds = new DataSet();
            DataAdapter da = new SqlDataAdapter((SqlCommand)cmd);
            da.Fill(ds);
            param.CurOut = (DbDataReader)ds.Tables[0].CreateDataReader();
        }

        public PkgMant.UitUpdateParam uitUpdate(Connection conn, Dictionary<string, string> map) {
            PkgMant.UitUpdateParam param = newUitUpdateParam(map);
            uitUpdate(conn, param);
            return param;
        }

        public PkgMant.UitUpdateParam uitUpdate(Connection conn, JSONObject json) {
            PkgMant.UitUpdateParam param = newUitUpdateParam(json);
            uitUpdate(conn, param);
            return param;
        }

        public PkgMant.UitUpdateParam uitUpdate(Connection conn) {
            PkgMant.UitUpdateParam param = newUitUpdateParam();
            uitUpdate(conn, param);
            return param;
        }

        public void uitUpdate(Connection conn, PkgMant.UitUpdateParam param) {
            DbCommand cmd = conn.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "[dbo].MAN_uit_update";
            DbParameter par = null;
            // idparametro
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@idparametro";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.Int32;
            if (param.Idparametro == null)
                par.Value = DBNull.Value;
            else
                par.Value = param.Idparametro;
            // valoparametro
            par = cmd.CreateParameter();
            cmd.Parameters.Add(par);
            par.ParameterName = "@valoparametro";
            par.Direction = ParameterDirection.Input;
            par.DbType = DbType.String;
            par.Size = 100;
            if (string.IsNullOrEmpty(param.Valoparametro))
                par.Value = DBNull.Value;
            else
                par.Value = param.Valoparametro;
            cmd.ExecuteNonQuery();
        }

        public PkgMant.ActGetlistParam newActGetlistParam() {
            return new ActGetlistParam();
        }

        public PkgMant.ActGetlistParam newActGetlistParam(Dictionary<string, string> map) {
            return new ActGetlistParam(map);
        }

        public PkgMant.ActGetlistParam newActGetlistParam(JSONObject json) {
            return new ActGetlistParam(json);
        }

        public PkgMant.ClasificacionSearchParam newClasificacionSearchParam() {
            return new ClasificacionSearchParam();
        }

        public PkgMant.ClasificacionSearchParam newClasificacionSearchParam(Dictionary<string, string> map) {
            return new ClasificacionSearchParam(map);
        }

        public PkgMant.ClasificacionSearchParam newClasificacionSearchParam(JSONObject json) {
            return new ClasificacionSearchParam(json);
        }

        public PkgMant.FormatoGetlistParam newFormatoGetlistParam() {
            return new FormatoGetlistParam();
        }

        public PkgMant.FormatoGetlistParam newFormatoGetlistParam(Dictionary<string, string> map) {
            return new FormatoGetlistParam(map);
        }

        public PkgMant.FormatoGetlistParam newFormatoGetlistParam(JSONObject json) {
            return new FormatoGetlistParam(json);
        }

        public PkgMant.UitGetbyidParam newUitGetbyidParam() {
            return new UitGetbyidParam();
        }

        public PkgMant.UitGetbyidParam newUitGetbyidParam(Dictionary<string, string> map) {
            return new UitGetbyidParam(map);
        }

        public PkgMant.UitGetbyidParam newUitGetbyidParam(JSONObject json) {
            return new UitGetbyidParam(json);
        }

        public PkgMant.UitGetlistParam newUitGetlistParam() {
            return new UitGetlistParam();
        }

        public PkgMant.UitGetlistParam newUitGetlistParam(Dictionary<string, string> map) {
            return new UitGetlistParam(map);
        }

        public PkgMant.UitGetlistParam newUitGetlistParam(JSONObject json) {
            return new UitGetlistParam(json);
        }

        public PkgMant.UitUpdateParam newUitUpdateParam() {
            return new UitUpdateParam();
        }

        public PkgMant.UitUpdateParam newUitUpdateParam(Dictionary<string, string> map) {
            return new UitUpdateParam(map);
        }

        public PkgMant.UitUpdateParam newUitUpdateParam(JSONObject json) {
            return new UitUpdateParam(json);
        }

        public class ActGetlistParam {

            private DbDataReader curOut;

            public ActGetlistParam() {
            }

            public ActGetlistParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public ActGetlistParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public DbDataReader CurOut {
                get { return curOut; }
                set { this.curOut = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

        public class ClasificacionSearchParam {

            private string nombclasificacion;
            private DbDataReader curOut;

            public ClasificacionSearchParam() {
            }

            public ClasificacionSearchParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public ClasificacionSearchParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public string Nombclasificacion {
                get { return nombclasificacion; }
                set { this.nombclasificacion = value; }
            }

            public DbDataReader CurOut {
                get { return curOut; }
                set { this.curOut = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

        public class FormatoGetlistParam {

            private DbDataReader curOut;

            public FormatoGetlistParam() {
            }

            public FormatoGetlistParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public FormatoGetlistParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public DbDataReader CurOut {
                get { return curOut; }
                set { this.curOut = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

        public class UitGetbyidParam {

            private int? idparametro;
            private DbDataReader curOut;

            public UitGetbyidParam() {
            }

            public UitGetbyidParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public UitGetbyidParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public int? Idparametro {
                get { return idparametro; }
                set { this.idparametro = value; }
            }

            public DbDataReader CurOut {
                get { return curOut; }
                set { this.curOut = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

        public class UitGetlistParam {

            private DbDataReader curOut;

            public UitGetlistParam() {
            }

            public UitGetlistParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public UitGetlistParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public DbDataReader CurOut {
                get { return curOut; }
                set { this.curOut = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

        public class UitUpdateParam {

            private int? idparametro;
            private string valoparametro;

            public UitUpdateParam() {
            }

            public UitUpdateParam(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public UitUpdateParam(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

            public int? Idparametro {
                get { return idparametro; }
                set { this.idparametro = value; }
            }

            public string Valoparametro {
                get { return valoparametro; }
                set { this.valoparametro = value; }
            }

            public void setValuesFromMap(Dictionary<string, string> map) {
                ResourceManager.populateDtoFromMap(this, map);
            }

            public void setValuesFromMap(JSONObject json) {
                ResourceManager.populateDtoFromMap(this, json);
            }

        }

    }
}
